/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package xq.gwt.mvc.controller;

import xq.gwt.mvc.model.DatePropertyModel;
import xq.gwt.mvc.view.DatePropertyView;

/**
 *
 * @author admin
 */
public class DatePropertyController extends AbstractPropertyController{
    protected DatePropertyView dateView;
    protected DatePropertyModel dateModel;

    public DatePropertyController(DatePropertyView dateView){
        super(dateView);
        this.dateView = dateView;
    }

    public void setPropertyModel(DatePropertyModel dateModel){
        this.dateModel = dateModel;
        super.setPropertyModel(dateModel);
        
    }

    @Override
    public void updateModel() {
        if(dateModel != null)
            dateModel.setValue(dateView.getDate());
    }

    @Override
    public void updateView() {
        if(dateView != null)
           dateView.setDate(dateModel.getValue());
    }

}
